{extend name="layouts@base" /}
{block name="head"}
<link rel="stylesheet" href="__STATIC__/mobile/default/css/wallet.css"/>
{/block}
{block name='pageType'}chongzhi{/block}
{block name="main" }
<div class="page-bd">
    <!-- 页面内容-->
    <div class="inputBlock">
        <div class="tips fs24 fw_b color_9">支付金额</div>
        <input type="number" class="fs60 num " id="amount">
        
    </div>

    <div class="paytype">
    </div>
    <div class="button fs32 fw_b color_w BGcolor_r postBtn">确认</div>

</div>
{/block}

{block name="footer"}
<script>
$(function() {
	//end
	//提交
	$('.postBtn').click(function(){
        var arr = new Object();
        arr.amount = $("#amount").val();
        arr.user_id ={$user_id};

        if(arr.amount!= null && arr.amount != ""&&arr.amount!="0"){
            // var exp = /^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
            var exp = /^[1-9]{1}\d*(.\d{1,2})?$|^0.\d{1,2}$/;
            if(!exp.test(arr.amount)){
                _alert('金额格式不支付支付正确.');
                return false;
            }
        }else{
            _alert('金额不能为空.');
            return false;
        }
        // console.log(amount);return false;
        // window.location.href = '{:_url("shop/api.flow/addSotreOrder",'',false)}/?user_id={$user_id}&pay_code=weixin&amount='+amount;
		jq_ajax('{:url("shop/api.flow/addSotreOrder")}',arr,function(res){
            console.log(res)
			if (res.code == 0){
				_alert(res.msg);
				return false;
			}
            window.location.href = '{:_url("shop/index/get_store_pay",'',false)}/&order_id='+res.order_id;
		})
	})

})
</script>
{/block}